<!DOCTYPE html>
<html>
<meta charset="UTF-8">

<head>
    <h1 style="text-align: center;">三级页面</h1>
</head>

<body>
<p>三级页面</p>


<input id="itemId" style="font-size: 16px;padding: 6px" type="text"/>
<a style="color: white;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 16px;width: 100px;padding:6px;background-color: #98bf21;
    text-decoration: none;text-align: center;border: none;cursor: pointer;" onclick="showDetailFromJS()">根据id打开商品详情</a>
<a style="color: white;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 16px;width: 100px;padding:6px;background-color: #98bf21;
    text-decoration: none;text-align: center;border: none;cursor: pointer;" onclick="addToCartFromJS()">添加商品到购物车</a>
<div style="margin-top:10px; margin-bottom:10px;">
    <input id="shopId" style="font-size: 16px;padding: 6px" type="text"/>
    <a style="color: white;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 16px;width: 100px; margin-top:10px; margin-bottom:10px; padding:6px;background-color: #98bf21;
    text-decoration: none;text-align: center;border: none;cursor: pointer;" onclick="showShopFromJS()">根据id打开商铺</a>
</div>
<a style="display:block;color: white;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 16px;width: 100px; margin-top:10px; margin-bottom:10px;padding:6px;background-color: #98bf21;
    text-decoration: none;text-align: center;border: none;cursor: pointer;" onclick="showOrderFromJS()">显示订单</a>
<a style="display:block;color: white;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 16px;width: 100px; margin-top:10px; margin-bottom:10px;padding:6px;background-color: #98bf21;
    text-decoration: none;text-align: center;border: none;cursor: pointer;" onclick="showCartFromJS()">显示购物车</a>
<a style="display:block;color: white;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 16px;width: 100px; margin-top:10px; margin-bottom:10px;padding:6px;background-color: #98bf21;
    text-decoration: none;text-align: center;border: none;cursor: pointer;" onclick="showUrlFromJS()">打开指定链接</a>
<script>

			function showDetailFromJS() {
			    var ua = navigator.userAgent.toLowerCase();
			    var itemId = document.getElementById("itemId").value;

                if (ua.match(/iphone/ig) || ua.match(/ipad/ig)){
				    showDetail(itemId);
                }else{
				    window.Android.showDetail(itemId);
                }
			 }

			function showShopFromJS() {
			    var ua = navigator.userAgent.toLowerCase();
			    var shopId = document.getElementById("shopId").value;

                if (ua.match(/iphone/ig) || ua.match(/ipad/ig)){
				    showShop(shopId);
                }else{
				    window.Android.showShop(shopId);
                }
			 }

			function addToCartFromJS() {
			    var ua = navigator.userAgent.toLowerCase();
			    var itemId = document.getElementById("itemId").value;

                if (ua.match(/iphone/ig) || ua.match(/ipad/ig)){
				    addToCart(itemId);
                }else{
				    window.Android.addToCart(itemId);
                }
			 }

			function showOrderFromJS() {
			    var ua = navigator.userAgent.toLowerCase();
                if (ua.match(/iphone/ig) || ua.match(/ipad/ig)){
				    showOrder();
                }else{
				    window.Android.showOrder();
                }
			 }

			function showCartFromJS() {
			    var ua = navigator.userAgent.toLowerCase();
                if (ua.match(/iphone/ig) || ua.match(/ipad/ig)){
				    showCart();
                }else{
				    window.Android.showCart();
                }
			 }

			function showUrlFromJS() {
			    var ua = navigator.userAgent.toLowerCase();
			    var url = "https://item.taobao.com/item.htm?spm=a219e.1191392.1111.1.5EJUkZ&id=521613391305&scm=1029.newlist-0.1.50002766&ppath=&sku=&ug=#detail;"
                if (ua.match(/iphone/ig) || ua.match(/ipad/ig)){
				    showUrl(url);
                }else{
				    window.Android.showUrl(url);
                }
			 }

</script>

</body>

</html>